package com.motos;

public abstract class Moto implements Calc,Bluetooth,Navigate{
    private String no,color;
    private double price;

    public Moto() {
    }

    public Moto(String no, String color, double price) {
        this.no = no;
        this.color = color;
        this.price = price;
    }

    public String getNo() {
        return no;
    }

    public void setNo(String no) {
        this.no = no;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public double getPrice() {
        return price;
    }

    protected void setPrice(double price) {
        this.price = price;
    }
    public boolean equals(Object obj){
        //比较车牌号是否相同
        if (this ==obj) {
            return true;
        }else
            if (obj instanceof Moto) {
            Moto m=(Moto)obj;
                if (this.no.equals(m.no)) {
                    return true;
                }
                else return false;
        }
          return false;
    }

    @Override
//    public String toString() {
//        return super.toString();
//    }

    public double calcRent(int days){
        return this.price*days;
    }
    public void blueTooth(){}
    public void navigate(){}
}
